<!--
* description: 流程节点弹出框
* author: liks
* createdDate: 2019-10-31
-->
<style lang="scss" scoped>
/deep/ .el-table--fit {
  max-height: 355px !important;
}
</style>
<template>
  <section class="carTypeConfig">
    <el-dialog
      v-dialogDrag
      title="流程节点"
      :visible.sync="curPopupsVisible"
      width="1000px"
      center
      @close="sendCode"
      :close-on-click-modal="false"
      :append-to-body="true"
    >
      <dialogHeader slot="title" :title="'流程节点'" :styleType="$store.state.app.dialogType"></dialogHeader>
      <one-table-template
        ref="multipleTable"
        :dynamicButtons="tableButtons"
        :dynamicComponents="tableComponents"
        :dynamicApiConfig="apiConfig"
        :dynamicTableCols="tableCols"
        :dynamicFormFields="formField"
        :dynamicIsShowSelect="false"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
import { crmApis } from "@/api/apiList/crm";
import OneTableTemplate from "@/components/crm/commonComponents/crmPopupsOneTable";
export default {
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, valueObjectMixins],
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: crmApis.csDbNodeQueryFindAll,
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          type: "primary",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: "查询",
          position: "top"
        },
        {
          compKey: "btnKey2",
          type: "primary",
          size: "small",
          clickEvent: () => this.sendCode(this.codeField, "nodeName"),
          text: "确认",
          position: "bottom"
        },
        {
          compKey: "btnKey3",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: "重置",
          position: "top"
        }
      ],
      // 动态组件-查询条件
      tableComponents: [
        // 显示组件
        {
          compKey: "compKey1",
          labelName: "业务流程",
          codeField: "serverType",
          lookuptype: "LX009",
          component: () => import("@/components/crm/lookupValue/lookupvalue"),
          type: "dropdownList",
          isMust: true,
          isMul: false
        },
        {
          compKey: "compKey2",
          labelName: "节点名称",
          codeField: "nodeName",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true
        }
      ],
      // 动态生成网格列
      tableCols: [
        {
          prop: "serverTypeName",
          label: "业务流程",
          width: null,
          align: "center"
        },
        { prop: "nodeCode", label: "节点编码", width: null, align: "center" },
        { prop: "nodeName", label: "节点名称", width: null, align: "center" }
      ],
      //表单查询数据（查询条件）
      formField: {
        isEnable: "1",
        // positionCode:"VE0001",
        groupType: "",
        serverType: "",
        nodeName: ""
      },
      //双击事件
      handleTableRowData:{
        value:this.codeField,
        text:"nodeName"
      }
    };
  },
  mounted() {
    let parent = this.$utils.getHasFormFieldParentComponent(this);
    if (parent.formField && parent.formField.serverType) {
      this.formField.serverType = parent.formField.serverType;
    }
  },
  methods: {}
};
</script>
